{include file="public/meat" title="添加/编辑用户信息"/}
{include file="public/js" /}
{load href="__EDITOR__/wangEditor.min.js" /}
<script type="text/javascript">
    var E = window.wangEditor;
</script>
<div class="cx-fex-c">
    <div class="x11 pad-t15 pad-b10">
        <div class="cx-fex-c">
            <div class="layout">
                <a href="{:url('laoshi')}" class="button bg-blue">返回列表</a>
            </div>
        </div>
    </div>
    <div class="x11">
        <fieldset class="cx-field">
            <legend class="cx-field-legend">添加/编辑用户信息</legend>
            <form class="layui-form" id="addform"  role="form" action="" method="post">
                <h2 class="t-c b-b t-red t-18 mb-20">必填项</h2>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">工号</label></div>
                    <div class="xs8 xl9"><input type="text" name="gonghao" placeholder="请输入工号" class="ipt" value="{$postdb.gonghao|default=''}"></div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">用户名<span class="t-red">(*)</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" class="ipt" placeholder="请输入用户名" {present name="postdb.username"}disabled{/present} required  lay-verify="required" name="username" value="{$postdb.username|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">用户昵称<span class="t-red">(*)</span> </label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="uniname" class="ipt" placeholder="请输入用户昵称" required  lay-verify="required" value="{$postdb.uniname|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">电子邮箱<span class="t-red">(*)</span> </label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="uemail" class="ipt" placeholder="请输入电子邮箱" {present name="postdb.uemail_yz"}{eq name="postdb.uemail_yz" value="1"}disabled{/eq}{/present} required  lay-verify="required|email" value="{$postdb.uemail|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">特约费</label></div>
                    <div class="xs8 xl9">
                        <div class="cx-input-tabel">
                            <input type="text" name="vipmoney" placeholder="请输入特约费" class="ipt" value="{$postdb.vipmoney|default='0'}">
                            <span class="cx-input-fl">元</span>
                        </div>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">课时费</label></div>
                    <div class="xs8 xl9">
                        <div class="cx-input-tabel">
                            <input type="text" name="classmoney" placeholder="请输入课时费" class="ipt" value="{$postdb.classmoney|default='0'}">
                            <span class="cx-input-fl">元</span>
                        </div>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">开户行</label></div>
                    <div class="xs8 xl9">
                        <select name="bank_name" required="" lay-verify="required" lay-filter="*">
                            <option value="">请选择银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="1020000"}selected="selected"{/eq} value="1020000">中国工商银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="1030000"}selected="selected"{/eq} value="1030000">中国农业银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3080000"}selected="selected"{/eq} value="3080000">招商银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3010000"}selected="selected"{/eq} value="3010000">交通银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="1050001"}selected="selected"{/eq} value="1050001">中国建设银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3050000"}selected="selected"{/eq} value="3050000">中国民生银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3090000"}selected="selected"{/eq} value="3090000">兴业银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="1040000"}selected="selected"{/eq} value="1040000">中国银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="63100000"}selected="selected"{/eq} value="63100000">浦发银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3030000"}selected="selected"{/eq} value="3030000">中国光大银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="1009999"}selected="selected"{/eq} value="1009999">中国邮政储蓄银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3070010"}selected="selected"{/eq} value="3070010">平安银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3040000"}selected="selected"{/eq} value="3040000">华夏银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3060000"}selected="selected"{/eq} value="3060000">广发银行</option>
                            <option {eq name="$postdb.bank_name|default=''" value="3020000"}selected="selected"{/eq} value="3020000">中信银行</option>
                        </select>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">银行卡号</label></div>
                    <div class="xs8 xl9"><input type="text" name="bankcard" placeholder="请输入银行卡号" class="ipt" value="{$postdb.bankcard|default=''}"></div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">民族</label></div>
                    <div class="xs8 xl9"><select id="nation" name="nation" lay-filter="nation">
                        <option value=''>请选择民族</option>
                        <option value="汉族" {eq name="postdb.nation|default='汉族'" value="汉族" }selected="selected" {/eq}>汉族</option>
                        <option value="壮族" {eq name="postdb.nation|default='汉族'" value="壮族" }selected="selected" {/eq}>壮族</option>
                        <option value="满族" {eq name="postdb.nation|default='汉族'" value="满族" }selected="selected" {/eq}>满族</option>
                        <option value="回族" {eq name="postdb.nation|default='汉族'" value="回族" }selected="selected" {/eq}>回族</option>
                        <option value="苗族" {eq name="postdb.nation|default='汉族'" value="苗族" }selected="selected" {/eq}>苗族</option>
                        <option value="维吾尔族" {eq name="postdb.nation|default='汉族'" value="维吾尔族" }selected="selected" {/eq}>维吾尔族</option>
                        <option value="土家族" {eq name="postdb.nation|default='汉族'" value="土家族" }selected="selected" {/eq}>土家族</option>
                        <option value="彝族" {eq name="postdb.nation|default='汉族'" value="彝族" }selected="selected" {/eq}>彝族</option>
                        <option value="蒙古族" {eq name="postdb.nation|default='汉族'" value="蒙古族" }selected="selected" {/eq}>蒙古族</option>
                        <option value="藏族" {eq name="postdb.nation|default='汉族'" value="藏族" }selected="selected" {/eq}>藏族</option>
                        <option value="布依族" {eq name="postdb.nation|default='汉族'" value="布依族" }selected="selected" {/eq}>布依族</option>
                        <option value="侗族" {eq name="postdb.nation|default='汉族'" value="侗族" }selected="selected" {/eq}>侗族</option>
                        <option value="瑶族" {eq name="postdb.nation|default='汉族'" value="瑶族" }selected="selected" {/eq}>瑶族</option>
                        <option value="朝鲜族" {eq name="postdb.nation|default='汉族'" value="朝鲜族" }selected="selected" {/eq}>朝鲜族</option>
                        <option value="白族" {eq name="postdb.nation|default='汉族'" value="白族" }selected="selected" {/eq}>白族</option>
                        <option value="哈尼族" {eq name="postdb.nation|default='汉族'" value="哈尼族" }selected="selected" {/eq}>哈尼族</option>
                        <option value="哈萨克族" {eq name="postdb.nation|default='汉族'" value="哈萨克族" }selected="selected" {/eq}>哈萨克族</option>
                        <option value="黎族" {eq name="postdb.nation|default='汉族'" value="黎族" }selected="selected" {/eq}>黎族</option>
                        <option value="傣族" {eq name="postdb.nation|default='汉族'" value="傣族" }selected="selected" {/eq}>傣族</option>
                        <option value="畲族" {eq name="postdb.nation|default='汉族'" value="畲族" }selected="selected" {/eq}>畲族</option>
                        <option value="傈僳族" {eq name="postdb.nation|default='汉族'" value="傈僳族" }selected="selected" {/eq}>傈僳族</option>
                        <option value="仡佬族" {eq name="postdb.nation|default='汉族'" value="仡佬族" }selected="selected" {/eq}>仡佬族</option>
                        <option value="东乡族" {eq name="postdb.nation|default='汉族'" value="东乡族" }selected="selected" {/eq}>东乡族</option>
                        <option value="高山族" {eq name="postdb.nation|default='汉族'" value="高山族" }selected="selected" {/eq}>高山族</option>
                        <option value="拉祜族" {eq name="postdb.nation|default='汉族'" value="拉祜族" }selected="selected" {/eq}>拉祜族</option>
                        <option value="水族" {eq name="postdb.nation|default='汉族'" value="水族" }selected="selected" {/eq}>水族</option>
                        <option value="佤族" {eq name="postdb.nation|default='汉族'" value="佤族" }selected="selected" {/eq}>佤族</option>
                        <option value="纳西族" {eq name="postdb.nation|default='汉族'" value="纳西族" }selected="selected" {/eq}>纳西族</option>
                        <option value="羌族" {eq name="postdb.nation|default='汉族'" value="羌族" }selected="selected" {/eq}>羌族</option>
                        <option value="土族" {eq name="postdb.nation|default='汉族'" value="土族" }selected="selected" {/eq}>土族</option>
                        <option value="仫佬族" {eq name="postdb.nation|default='汉族'" value="仫佬族" }selected="selected" {/eq}>仫佬族</option>
                        <option value="锡伯族" {eq name="postdb.nation|default='汉族'" value="锡伯族" }selected="selected" {/eq}>锡伯族</option>
                        <option value="柯尔克孜族" {eq name="postdb.nation|default='汉族'" value="柯尔克孜族" }selected="selected" {/eq}>柯尔克孜族</option>
                        <option value="达斡尔族" {eq name="postdb.nation|default='汉族'" value="达斡尔族" }selected="selected" {/eq}>达斡尔族</option>
                        <option value="景颇族" {eq name="postdb.nation|default='汉族'" value="景颇族" }selected="selected" {/eq}>景颇族</option>
                        <option value="毛南族" {eq name="postdb.nation|default='汉族'" value="毛南族" }selected="selected" {/eq}>毛南族</option>
                        <option value="撒拉族" {eq name="postdb.nation|default='汉族'" value="撒拉族" }selected="selected" {/eq}>撒拉族</option>
                        <option value="塔吉克族" {eq name="postdb.nation|default='汉族'" value="塔吉克族" }selected="selected" {/eq}>塔吉克族</option>
                        <option value="阿昌族" {eq name="postdb.nation|default='汉族'" value="阿昌族" }selected="selected" {/eq}>阿昌族</option>
                        <option value="普米族" {eq name="postdb.nation|default='汉族'" value="普米族" }selected="selected" {/eq}>普米族</option>
                        <option value="鄂温克族" {eq name="postdb.nation|default='汉族'" value="鄂温克族" }selected="selected" {/eq}>鄂温克族</option>
                        <option value="怒族" {eq name="postdb.nation|default='汉族'" value="怒族" }selected="selected" {/eq}>怒族</option>
                        <option value="京族" {eq name="postdb.nation|default='汉族'" value="京族" }selected="selected" {/eq}>京族</option>
                        <option value="基诺族" {eq name="postdb.nation|default='汉族'" value="基诺族" }selected="selected" {/eq}>基诺族</option>
                        <option value="德昂族" {eq name="postdb.nation|default='汉族'" value="德昂族" }selected="selected" {/eq}>德昂族</option>
                        <option value="保安族" {eq name="postdb.nation|default='汉族'" value="保安族" }selected="selected" {/eq}>保安族</option>
                        <option value="俄罗斯族" {eq name="postdb.nation|default='汉族'" value="俄罗斯族" }selected="selected" {/eq}>俄罗斯族</option>
                        <option value="裕固族" {eq name="postdb.nation|default='汉族'" value="裕固族" }selected="selected" {/eq}>裕固族</option>
                        <option value="乌兹别克族" {eq name="postdb.nation|default='汉族'" value="乌兹别克族" }selected="selected" {/eq}>乌兹别克族</option>
                        <option value="门巴族" {eq name="postdb.nation|default='汉族'" value="门巴族" }selected="selected" {/eq}>门巴族</option>
                        <option value="鄂伦春族" {eq name="postdb.nation|default='汉族'" value="鄂伦春族" }selected="selected" {/eq}>鄂伦春族</option>
                        <option value="独龙族" {eq name="postdb.nation|default='汉族'" value="独龙族" }selected="selected" {/eq}>独龙族</option>
                        <option value="塔塔尔族" {eq name="postdb.nation|default='汉族'" value="塔塔尔族" }selected="selected" {/eq}>塔塔尔族</option>
                        <option value="赫哲族" {eq name="postdb.nation|default='汉族'" value="赫哲族" }selected="selected" {/eq}>赫哲族</option>
                        <option value="珞巴族" {eq name="postdb.nation|default='汉族'" value="珞巴族" }selected="selected" {/eq}>珞巴族</option>
                        <option value="布朗族" {eq name="postdb.nation|default='汉族'" value="布朗族" }selected="selected" {/eq}>布朗族</option>
                    </select>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">身份证城市</label></div>
                    <div class="xs8 xl9">
                        <div class="cx-input-tabel">{notempty name="postdb.jiguan"}{volist name="postdb.jiguan" id="cx" key="k"}<select class='jiguan' name="jiguan[{$k}]" lay-filter="chinacode" data-th='{$cx}' data-leve='{$k}' data-name='jiguan' data-class='don'></select>{/volist}
                            <script> $('.jiguan').each(function () {
                                var o = this, d = $(o).data();
                                if (d.leve == 1) {
                                    var x = '省份';
                                }
                                if (d.leve == 2) {
                                    var x = '市';
                                }
                                if (d.leve == 3) {
                                    var x = '县/区';
                                }
                                if (d.leve == 4) {
                                    var x = "乡/镇/街道";
                                }
                                $.ajax({
                                    async: false,
                                    type: "post",
                                    dataType: "json",
                                    data: {zoneid: d.th, class: 'this', type: 'num'},
                                    url: "/api/chinacode.html",
                                    success: function (res) {
                                        if (res.code == '1') {
                                            var sele = res.dondata;
                                            $(o).html("<option value=''>请选择" + x + "</option>");
                                            for (var i in sele) {
                                                if (d.th == sele[i].zoneid) {
                                                    $(o).append("<option value='" + sele[i].zoneid + "'selected='selected'>" + sele[i].zonename + "</option>");
                                                } else {
                                                    $(o).append("<option value='" + sele[i].zoneid + "'>" + sele[i].zonename + "</option>");
                                                }
                                            }
                                        }
                                    }
                                });
                            })</script>
                            {else /}
                            <select class='jiguan' name="jiguan[1]" lay-filter="chinacode" data-leve='1' data-name='jiguan'
                                    data-class='don' data-type='num'>
                                <option value="">请选择省</option>
                                <option value="110000">北京</option>
                                <option value="120000">天津</option>
                                <option value="130000">河北省</option>
                                <option value="140000">山西省</option>
                                <option value="150000">内蒙古自治区</option>
                                <option value="210000">辽宁省</option>
                                <option value="220000">吉林省</option>
                                <option value="230000">黑龙江省</option>
                                <option value="310000">上海</option>
                                <option value="320000">江苏省</option>
                                <option value="330000">浙江省</option>
                                <option value="340000">安徽省</option>
                                <option value="350000">福建省</option>
                                <option value="360000">江西省</option>
                                <option value="370000">山东省</option>
                                <option value="410000">河南省</option>
                                <option value="420000">湖北省</option>
                                <option value="430000">湖南省</option>
                                <option value="440000">广东省</option>
                                <option value="450000">广西壮族自治区</option>
                                <option value="460000">海南省</option>
                                <option value="500000">重庆</option>
                                <option value="510000">四川省</option>
                                <option value="520000">贵州省</option>
                                <option value="530000">云南省</option>
                                <option value="540000">西藏自治区</option>
                                <option value="610000">陕西省</option>
                                <option value="620000">甘肃省</option>
                                <option value="630000">青海省</option>
                                <option value="640000">宁夏回族自治区</option>
                                <option value="650000">新疆维吾尔自治区</option>
                                <option value="710000">台湾</option>
                                <option value="810000">香港特别行政区</option>
                                <option value="820000">澳门特别行政区</option>
                            </select>{/notempty}
                        </div>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">身份证地址</label></div>
                    <div class="xs8 xl9"><input type="text" name="cardaddres" placeholder="请输入身份证地址" class="ipt" value="{$postdb.cardaddres|default=''}"></div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">执业时间</label></div>
                    <div class="xs8 xl9"><input type="text" name="zhiyetime" placeholder="请选择执业时间" class="ipt cx-time" value="{$postdb.zhiyetime|default=''}"></div>
                </div>
                {present name="postdb.upassword"}
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">旧密码</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="password" class="ipt" {present name="postdb.upassword"}disabled value="******"{/present} >
                    </div>
                </div>
                {/present}
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">设置新密码</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="password" name="newpassword" class="ipt" placeholder="如果不更换密码,请留空">
                        <span class="t-gray">如果不更换密码,请留空</span>
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">选择会员组<span class="t-red">(*)</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <select name="group_id" lay-verify="required">
                            <option value="">请选择用户组</option>
                            {volist name="groupid" id="cx"}
                            <option {eq name="postdb.group_id|default=''" value="$cx.id"}selected{/eq} value="{$cx.id}">{$cx.title}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">用户状态<span class="t-red">(*)</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <input name="status" type="radio" value="1" {eq name="$postdb.status|default='1'" value="1"}checked="checked"{/eq} title="已通过">
                        <input name="status" type="radio" value="0" {eq name="$postdb.status|default=''" value="0"}checked="checked"{/eq} title="未通过">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">是否推荐<span class="t-red">(*)</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <input name="ujian" type="radio" value="1" {eq name="$postdb.ujian|default='1'" value="1"}checked="checked"{/eq} title="推荐">
                        <input name="ujian" type="radio" value="0" {eq name="$postdb.ujian|default=''" value="0"}checked="checked"{/eq} title="不推荐">
                    </div>
                </div>
                <h2 class="t-c b-b t-gray t-18 mb-20">选填项</h2>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">用户头像</label>
                    </div>
                    <div class="xs8 xl9">
                        <img class="picurlimg b-a" src="{present name='postdb.uicon'}/{$webdb.updir}/{$postdb.uicon}{/present}" onerror="this.src='__ADMIN__/usererror.png'" height="60" width="auto">
                        <span class="picurltext"></span>
                        <a class="button button-S bor-green uploadbtn" data-img="picurlimg" data-val="picurlval" data-text="picurltext" data-del="picurldel" lay-data="{method:'post',accept:'images',data:'img',field:'picurl'}"><i class="layui-icon">&#xe67c;</i>上传头像</a>
                        <a class="button button-S bor-red picurldel cx-click" data-img="picurlimg" data-val="picurlval" data-type="closdiv" {notpresent name="postdb.uicon"}style="display:none;"{/notpresent}><i class="layui-icon">&#xe67c;</i>删除</a>
                        <input name="uicon" class="ipt picurlval" placeholder="默认值一般为空" type="hidden" value="{$postdb.uicon|default=''}" >
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">姓名</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="uname" class="ipt" placeholder="请输入姓名" {present name="postdb.ucard_yz"}{eq name="postdb.ucard_yz" value="1"}disabled{/eq}{/present} value="{$postdb.uname|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">性别</label>
                    </div>
                    <div class="xs8 xl9">
                        <input name="usex" type="radio" value="1" {eq name="$postdb.usex|default=''" value="1"}checked="checked"{/eq} title="男">
                        <input name="usex" type="radio" value="0" {eq name="$postdb.usex|default='0'" value="0"}checked="checked"{/eq} title="女">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">手机号码</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="uphone" class="ipt" placeholder="请输入手机号码" {present name="postdb.uphone_yz"}{eq name="postdb.uphone_yz" value="1"}disabled{/eq}{/present} value="{$postdb.uphone|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">QQ号码</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="uicq" class="ipt" placeholder="请输入QQ号码" value="{$postdb.uicq|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">出生日期</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" id="ubday" name="ubday" class="ipt cx-time" placeholder="请选择出生日期" value="{$postdb.ubday|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">身份证号</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="ucard" class="ipt" {present name="postdb.ucard_yz"}{eq name="postdb.ucard_yz" value="1"}disabled{/eq}{/present} placeholder="请输入身份证号" value="{$postdb.ucard|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">所在城市</label>
                    </div>
                    <div class="xs8 xl9">
                        <div class="cx-input-tabel">
                            {empty name="postdb.ucity"}
                            <select class='cx-china-select' name="ucity[1]" lay-filter="chinacode" data-leve='1' data-name="ucity" data-class="don" data-type="num">
                                <option value="">请选择省份</option>
                                <option value="110000">北京</option>
                                <option value="120000">天津</option>
                                <option value="130000">河北省</option>
                                <option value="140000">山西省</option>
                                <option value="150000">内蒙古自治区</option>
                                <option value="210000">辽宁省</option>
                                <option value="220000">吉林省</option>
                                <option value="230000">黑龙江省</option>
                                <option value="310000">上海</option>
                                <option value="320000">江苏省</option>
                                <option value="330000">浙江省</option>
                                <option value="340000">安徽省</option>
                                <option value="350000">福建省</option>
                                <option value="360000">江西省</option>
                                <option value="370000">山东省</option>
                                <option value="410000">河南省</option>
                                <option value="420000">湖北省</option>
                                <option value="430000">湖南省</option>
                                <option value="440000">广东省</option>
                                <option value="450000">广西壮族自治区</option>
                                <option value="460000">海南省</option>
                                <option value="500000">重庆</option>
                                <option value="510000">四川省</option>
                                <option value="520000">贵州省</option>
                                <option value="530000">云南省</option>
                                <option value="540000">西藏自治区</option>
                                <option value="610000">陕西省</option>
                                <option value="620000">甘肃省</option>
                                <option value="630000">青海省</option>
                                <option value="640000">宁夏回族自治区</option>
                                <option value="650000">新疆维吾尔自治区</option>
                                <option value="710000">台湾</option>
                                <option value="810000">香港特别行政区</option>
                                <option value="820000">澳门特别行政区</option>
                            </select>
                            {else /}
                            {volist name="postdb.ucity" id="cx" key="k"}
                            <select class='cx-china-select' name="ucity[{$k}]" lay-filter="chinacode" data-th="{$cx}" data-leve='{$k}' data-name="ucity" data-class="don" data-type="num"></select>
                            {/volist}
                            <script>
                                $('.cx-china-select').each(function () {
                                    var o = this,
                                        d = $(o).data();
                                    if(d.leve == 1){
                                        var x = '省份';
                                    }
                                    if(d.leve == 2){
                                        var x = '市';
                                    }
                                    if(d.leve == 3){
                                        var x = '县/区';
                                    }
                                    if(d.leve == 4){
                                        var x = "乡/镇/街道";
                                    }
                                    $.ajax({
                                        async:false,
                                        type: "post",
                                        dataType: "json",
                                        data: {zoneid:d.th,class:'this',type:d.type},
                                        url: "/api/chinacode.html",
                                        success:function (res) {
                                            if(res.code == '1'){
                                                var sele = res.dondata;
                                                $(o).html("<option value=''>请选择"+ x +"</option>");
                                                for(var i in sele){
                                                    if(d.th == sele[i].zoneid){
                                                        $(o).append("<option value='"+sele[i].zoneid+"' selected='selected'>"+sele[i].zonename+"</option>");
                                                    }else{
                                                        $(o).append("<option value='"+sele[i].zoneid+"'>"+sele[i].zonename+"</option>");
                                                    }
                                                }
                                            }
                                        }
                                    });
                                })
                            </script>
                            {/empty}
                        </div>
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">详细地址</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="uaddress" class="ipt" placeholder="请输入联系地址" value="{$postdb.uaddress|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab">个性签名</label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="text" name="ugraph" class="ipt" placeholder="请填写个性签名" value="{$postdb.ugraph|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r"><label class="lab">个人介绍</label></div>
                    <div class="xs8 xl9">
                        <div id="brief">{$postdb.brief|default=''}</div>
                        <textarea id="brieftxt" class='hidden' name="brief">{$postdb.brief|default=''}</textarea></div>
                    <script type="text/javascript">
                        var brief = new E('#brief');
                        var $brieftxt = $('#brieftxt');
                        brief.customConfig.uploadImgServer = "{:url('Uploads/wangeditor')}";
                        brief.customConfig.uploadImgMaxSize = 1 * 1024 * 1024;
                        brief.customConfig.onchange = function (html) {
                            // 监控变化，同步更新到 textarea
                            $brieftxt.val(html);
                        }
                        brief.create();
                        $brieftxt.val(brief.txt.html());
                    </script>
                </div>
                <div class="cx-fex-l mb-15">
                    <div class="x3 t-r">
                        <label class="lab"></label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="hidden" name="id" class="layui-input" value="{$postdb.id|default=''}">
                        <input type="hidden" name="uid" class="layui-input" value="{$postdb.uid|default=''}">
                        <button class="button bg-blue" lay-submit lay-filter="button">确认提交</button>
                    </div>
                </div>
            </form>
        </fieldset>
    </div>
</div>
<div style="height: 20px; overflow: hidden"></div>

<script>
    layui.config({
        base: '__ADMIN__/js/'
    }).use('app');
    layui.define(['laydate','upload'], function(exports){
        var laydate = layui.laydate,
            layupload = layui.upload;
        laydate.render({
            elem: '#seefanwei',
            range: '---'
        });
        var uplogo = layupload.render({
            elem: '.uploadbtn',
            url:"{:url('Uploads/index')}",
            before: function(obj){
                layer.load();
            },
            done: function(res, index, upload){
                var cx = this.item.context.dataset;
                layer.closeAll('loading');
                if(res.code != 0){
                    $('.'+cx.text).html('<span style="color: #FF5722;">上传失败</span> <a class="btn size-S btn-primary-outline reload">重试</a>');
                    $('.'+cx.text).find('.reload').on('click', function(){
                        uplogo.upload();
                    });
                    return layer.msg(res.msg,{time: 2000});
                }
                $('.'+cx.img).attr('src','/'+ res.src);
                $('.'+cx.val).val(res.src);
                $('.'+cx.del).show();
                $('.'+cx.text).hide();
                return layer.msg(res.msg,{time: 2000})
            },
            error: function(){
                var cx = this.item.context.dataset;
                layer.closeAll('loading');
                $('.'+cx.text).html('<span style="color: #FF5722;">上传失败</span> <a class="btn size-S btn-primary-outline reload">重试</a>');
                $('.'+cx.text).find('.reload').on('click', function(){
                    uplogo.upload();
                });
            }
        });
        var dfeilds = layupload.render({
            elem: '.dfeilds',
            url:"{:url('Uploads/index')}",
            multiple: true,
            done: function(res, index, upload){
                var cx = this.item.context.dataset;
                var size = "";
                if(res.size < 0.1 * 1024){                            //小于0.1KB，则转化成B
                    size = res.size.toFixed(2) + "B"
                }else if(res.size < 0.1 * 1024 * 1024){            //小于0.1MB，则转化成KB
                    size = (res.size/1024).toFixed(2) + "KB"
                }else if(res.size < 0.1 * 1024 * 1024 * 1024){        //小于0.1GB，则转化成MB
                    size = (res.size/(1024 * 1024)).toFixed(2) + "MB"
                }else{                                            //其他转化成GB
                    size = (res.size/(1024 * 1024 * 1024)).toFixed(2) + "GB"
                }
                var sizeStr = size + "";                        //转成字符串
                var sizes = sizeStr.indexOf(".");                    //获取小数点处的索引
                var dou = sizeStr.substr(sizes + 1 ,2)            //获取小数点后两位的值
                if(dou == "00"){                                //判断后两位是否为00，如果是则删除00
                    size = sizeStr.substring(0, sizes) + sizeStr.substr(sizes + 3, 2)
                }
                if(cx.acc == 'img'){
                    var imgsee =  '<td><img src="/'+ res.src +'" height="100" width="auto">'+ res.title +'<input type="hidden" name="'+ cx.valname +'['+ res.title +']" class="ipt" value="'+ res.src +'"></td>';
                }else{
                    var imgsee =  '<td>'+ res.title +'<input type="hidden" name="'+ cx.valname +'['+ res.title +']" class="ipt" value="'+ res.src +'"></td>';
                }
                var tr = $(['<tr id="upload-'+ index +'">',
                    imgsee,
                    '<td>'+ res.msg +'</td>',
                    '<td class="t-c">'+ size +'</td>',
                    '<td class="t-c">',
                    '<button class="button bor-red m-reload layui-hide">重传</button>',
                    '<button class="button bg-red m-delete">删除</button>',
                    '</td>',
                    '</tr>'].join(''));
                if(res.code != 0){ //上传成功
                    var tr = $('#'+cx.tabel).find('tr#upload-'+ index),
                        tds = tr.children();
                    tds.eq(3).find('.m-reload').removeClass('layui-hide'); //显示重传
                }
                tr.find('.m-delete').on('click', function(){
                    tr.remove();
                    dfeilds.config.elem.next()[0].value = ''; //清空 input file 值，以免删除后出现同名文件不可选
                });
                $('#'+cx.tabd).append(tr);
                this.error(index, upload);
            },
            error: function(index, upload){
                var cx = this.item.context.dataset;
                var tr = $('#'+cx.tabel).find('tr#upload-'+ index),
                    tds = tr.children();
                tds.eq(2).html('<span style="color: #FF5722;">上传失败</span>');
                tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
            }
        });
    });
</script>
{include file="public/footer" /}